package com.rattsoftware.server.dao;

import java.util.List;

import com.rattsoftware.server.admin.model.CourseUnit;
import com.rattsoftware.server.admin.model.paging.PagingLoadConfig;
import com.rattsoftware.server.admin.model.paging.PagingLoadResult;

/**
 * Provides data access 
 * services to the <code>Course Unit service</code>.
 * 
 *
 */
public interface CourseUnitDAO extends BaseDAO<CourseUnit> {
	
	/**
	 * Gets a list of users in the database.
	 * 
	 * @return the user list.
	 */
	List<CourseUnit> getCourseUnits();
	
	/**
	 * Retrieves a CourseUnit by identifier
	 * 
	 * @param id Integer 
	 * @return CourseUnit, or null if no match found
	 */
	CourseUnit getCourseUnit(Integer id);
	
	/**
	 * Saves a courseUnit to the database.
	 * 
	 * @param courseUnit the courseUnit to save.
	 */
	void saveCourseUnit(CourseUnit courseUnit);
	
	/**
	 * Removes a courseUnit from the database.
	 * 
	 * @param courseUnit the courseUnit to remove.
	 * 
	 */
	void deleteCourseUnit(CourseUnit courseUnit);
	
	/**
	 * Retrieves a page of the course data.
	 * 
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of course data
	 */
	PagingLoadResult<CourseUnit> getCourseUnitList(PagingLoadConfig pagingLoadConfig);
	
	/**
	 * Retrieves a page of the course unit data that belongs to a given course.
	 * 
	 * @param courseId
	 *            Integer
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of Course Unit data
	 */
	PagingLoadResult<CourseUnit> getCourseUnitList(Integer courseId, PagingLoadConfig pagingLoadConfig);
}
